package com.lanou.renrenxin.welcome;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.lanou.renrenxin.R;
import com.lanou.renrenxin.activity.LoginActivity;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by dllo on 16/3/1.
 */
public class WelcomeActivity extends Activity {
    private TitanicTextView ttvOne,ttvTwo;
    private TextView textView;
    private ImageView imageView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        ttvOne = (TitanicTextView) findViewById(R.id.my_text_view);
        ttvTwo = (TitanicTextView) findViewById(R.id.myTextView);
        textView = (TextView) findViewById(R.id.app_themeWord);
        imageView = (ImageView) findViewById(R.id.xiaolaba);
        ttvOne.setRotationY(20);
        ttvTwo.setRotationY(-20);
        textView.setRotationY(-30);
        imageView.setRotationY(-20);

        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                Intent intent = new Intent(WelcomeActivity.this,LoginActivity.class);
                startActivity(intent);
                WelcomeActivity.this.finish();
            }
        };
        timer.schedule(task,4500);

        //开始动画
        Titanic titanic = new Titanic();
        Titanic titanic1 = new Titanic();
        titanic.start(ttvOne);
        titanic1.start(ttvTwo);
        //结束动画
        titanic.cancel();
        titanic1.cancel();
    }
}
